MainPanel = function(){
    MainPanel.superclass.constructor.call(this, {
    	id:'main-view',
        activeTab:0,
        region:'center',
        margins:'0 4 4 0',
        resizeTabs:true,
        tabWidth:120,
        minTabWidth: 120,
        enableTabScroll: true,
        plugins: new Ext.ux.TabCloseMenu(),
        items : [{
        	id : 'mainPanel',
        	xtype : 'panel',
        	title : 'Principal'
        }]
    });
};

Ext.extend(MainPanel, Ext.TabPanel, {

	carregaFuncMenu : function(FuncMenuSelecionado){
    	if(!(tab = this.getItem(FuncMenuSelecionado.id))){
    		if(!(tab = this.getItem(FuncMenuSelecionado.id))){
                tab = new Ext.Panel({
                    id: FuncMenuSelecionado.id,
                    //cls:'preview single-preview',
                    title: FuncMenuSelecionado.text,
                    //html: FeedViewer.getTemplate().apply(d),
                    closable:true,
                    //listeners: FeedViewer.LinkInterceptor,
                    autoScroll:true,
                    tbar: [{
                        text: 'Go to Post',
                        iconCls: 'new-win',
                        handler : function(){                    	
                    		// window.open(d.link);
                        }
                    }]
                });
                this.add(tab);
            }
    	}
    	this.setActiveTab(tab);
    }

    /*
    openTab : function(record){
        record = (record && record.data) ? record : this.gsm.getSelected();
        var d = record.data;
        var id = !d.link ? Ext.id() : d.link.replace(/[^A-Z0-9-_]/gi, '');
        var tab;
        if(!(tab = this.getItem(id))){
            tab = new Ext.Panel({
                id: id,
                cls:'preview single-preview',
                title: d.title,
                tabTip: d.title,
                html: FeedViewer.getTemplate().apply(d),
                closable:true,
                listeners: FeedViewer.LinkInterceptor,
                autoScroll:true,
                border:true,

                tbar: [{
                    text: 'Go to Post',
                    iconCls: 'new-win',
                    handler : function(){
                        window.open(d.link);
                    }
                }]
            });
            this.add(tab);
        }
        this.setActiveTab(tab);
    }
    */
});